package cn.xyf.eduservice.controller;

import cn.xyf.commonutils.R;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@Api(tags = "登录模块")
@RestController
@RequestMapping("/eduservice/user")
@CrossOrigin
public class EduLoginController {

    @PostMapping("/login")
    public R login(){
        ArrayList<String> list = new ArrayList<>();
        list.add("admin");
        HashMap<String, Object> hashMap = new HashMap<>();
        hashMap.put("roles",list);
        hashMap.put("token","vue-admin-template");
        return R.ok().data(hashMap);
    }

    @GetMapping("/info")
    public R info(){
        ArrayList<String> list = new ArrayList<>();
        list.add("admin");
        HashMap<String, Object> hashMap = new HashMap<>();
        hashMap.put("roles",list);
        hashMap.put("name","张三");
        return R.ok().data(hashMap);
    }
}
